# Copyright (c) 2021 Presto Labs Pte. Ltd.
# Author: leon

from dataclasses import dataclass
from web3.eth import Contract
from coin.exchange.uniswap_base.types import AddressLike
from coin.exchange.uniswap_base.token import BaseToken


@dataclass
class BEP20Token(BaseToken):
  """Represents an BEP20 token"""

  name: str
  """Name of the token, as specified in the contract."""

  decimals: int
  """Decimals used to denominate the token."""

  def __repr__(self) -> str:
    return f"Token({self.symbol}, {self.address!r}, {self.decimals})"


@dataclass
class Pair:
  symbol: str
  contract: Contract
  token0: BEP20Token
  token1: BEP20Token
  fee: int
  base_then_quote: bool

  def __repr__(self) -> str:
    return f"Token({self.symbol}, {self.token0}, {self.token1}, {self.fee})"
